#ifndef TJ_form_barcode_return_H
#define TJ_form_barcode_return_H

#include <QDialog>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QNetworkInterface>
#include <QNetworkRequest>
#include <QJsonObject>
#include <QJsonArray>
#include <QSqlQuery>
#include <QMap>
#include <QSqlQueryModel>
#include <QSoundEffect>



namespace Ui {
class tj_form_barcode_return;
}

class tj_form_barcode_return : public QDialog
{
    Q_OBJECT

public:
    explicit tj_form_barcode_return(QWidget *parent = nullptr);
    ~tj_form_barcode_return();

    void closeEvent(QCloseEvent *event);



signals:

    void destroyW(QString);

public slots:

    void prepare_display(QString, QString);
    void set_value_saved(bool);
    QString return_codes();
    QList<QMap<QString, QString>> return_values();


private slots:

    void tm_code_input_timeout();
    void tm_display_delay_timeout();

    void on_le_code_returnPressed();

    void on_pb_exit_clicked();

    void on_pb_save_clicked();

    void on_le_code_textChanged(const QString &arg1);

    void on_pb_retrive_clicked();

private:
    Ui::tj_form_barcode_return *ui;

    QSqlQuery *qrm, *qrmt, *qro, *qrot;

    QString sq;
    QSqlQueryModel *md_item_list;
    QNetworkRequest request;
    QNetworkAccessManager manager ;

    QMap<QString, QString> drug_info;
    QString cur_clinic_code, cur_recipe_no;
    //QMap<QString, QString> recipe_info;

    bool recipe_finished;   //处方调配完成标志

    QTimer *tm_code_input;
    QTimer *tm_display_delay;

    QString current_status;

    bool value_saved;

};

#endif // TJ_form_barcode_return_H
